<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:o="http://omnifaces.org/ui"
      xmlns:jsf="http://xmlns.jcp.org/jsf"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      lang="#{dataverseSession.localeCode}"
      xml:lang="#{dataverseSession.localeCode}">
    <f:view locale="#{dataverseSession.localeCode}">
    <ui:insert name="metadata" />
    <h:head>
        <o:importFunctions type="edu.harvard.iq.dataverse.util.MarkupChecker" />
        <f:facet name="first">
            <o:resourceInclude path="/CustomizationFilesServlet?customFileType=analytics" />
            <title><h:outputText value="#{pageTitle}"/></title>
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <meta name="viewport" content="width=device-width, initial-scale=1"/>
            <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	    <ui:insert name="meta_header"></ui:insert>
            <ui:insert name="dc_meta_header"></ui:insert>
	    <ui:insert name="og_header"></ui:insert>
	    <ui:insert name="jsonld_header"></ui:insert>
        </f:facet>
        <link rel="apple-touch-icon" sizes="180x180" href="#{resource['images/fav/apple-touch-icon.png']}"/>
        <link rel="icon" type="image/png" sizes="16x16" href="#{resource['images/fav/favicon-16x16.png']}"/>
        <link rel="icon" type="image/png" sizes="32x32" href="#{resource['images/fav/favicon-32x32.png']}"/>
        <link rel="manifest" href="#{resource['images/fav/site.webmanifest']}"/>
        <link rel="mask-icon" href="#{resource['images/fav/safari-pinned-tab.svg']}" color="#da532c"/>
        <meta name="msapplication-TileColor" content="#da532c"/>
        <meta name="theme-color" content="#ffffff"/>
        <link type="image/png" rel="image_src" href="#{resource['images/dataverseproject.png']}" />
        <link type="text/css" rel="stylesheet" href="#{resource['bs/css/bootstrap.min.css']}?version=#{settingsWrapper.appVersion}" />
        <link type="text/css" rel="stylesheet" href="#{resource['bs/css/bootstrap-theme.min.css']}?version=#{settingsWrapper.appVersion}" />
        <link type="text/css" rel="stylesheet" href="#{resource['css/ie-compat.css']}?version=#{settingsWrapper.appVersion}" />
        <link type="text/css" rel="stylesheet" href="#{resource['css/owl.carousel.css']}?version=#{settingsWrapper.appVersion}" />
        <link type="text/css" rel="stylesheet" href="#{resource['css/fontcustom.css']}?version=#{settingsWrapper.appVersion}" />
        <link type="text/css" rel="stylesheet" href="#{resource['css/socicon.css']}?version=#{settingsWrapper.appVersion}" />
        <link type="text/css" rel="stylesheet" href="#{resource['css/structure.css']}?version=#{settingsWrapper.appVersion}" />
	<ui:fragment rendered="#{!empty settingsWrapper.get(':StyleCustomizationFile')}">
            <style>
                /* Custom CSS */
                <o:resourceInclude path="/CustomizationFilesServlet?customFileType=style" />
            </style>
        </ui:fragment>
    </h:head>
    <h:body styleClass="#{widgetWrapper.widgetView ? 'widget-view' : ''}">
        <f:loadBundle basename="propertyFiles.Bundle" var="bundle"/>
	<a href="#content" class="sr-only">#{bundle['body.skip']}</a>                
        <ui:include src="dataverse_header.xhtml">
            <ui:param name="dataverse" value="#{dataverse != null ? dataverse : settingsWrapper.rootDataverse}"/>
            <ui:param name="editModeDataverse" value="#{editModeDataverse}"/>
            <ui:param name="showDataverseHeader" value="#{showDataverseHeader != null ? showDataverseHeader : true}"/>
            <ui:param name="showMessagePanel" value="#{showMessagePanel != null ? showMessagePanel : true}"/>
            <ui:param name="loginRedirectPage" value="#{loginRedirectPage != null ? '?redirectPage='.concat(loginRedirectPage) : navigationWrapper.redirectPage}"/>
        </ui:include>
        <div class="container" id="content" role="main">
            <ui:insert name="body">#{bundle.defaultBody}</ui:insert>
        </div>
        <!-- FOOTER BLOCK -->
        <ui:include src="dataverse_footer.xhtml">
            <ui:param name="widgetView" value="#{widgetWrapper.widgetView}"/>
            <ui:param name="loginRedirectPage" value="#{loginRedirectPage != null ? '?redirectPage='.concat(loginRedirectPage) : navigationWrapper.redirectPage}"/>
        </ui:include>
        <p:ajaxStatus id="ajaxStatusPanel">
            <f:facet name="start">
                <h:graphicImage value="/resources/images/ajax-loading.gif" alt="#{bundle['loading']}" />
            </f:facet>
            <f:facet name="complete">
                <!-- DO NOTHING -->
            </f:facet> 
        </p:ajaxStatus>
        <ui:include src="contactFormFragment.xhtml"></ui:include>
        <script src="#{resource['js/dv_rebind_bootstrap_ui.js']}?version=#{settingsWrapper.appVersion}"></script>
        <script src="#{resource['bs/js/bootstrap.min.js']}?version=#{settingsWrapper.appVersion}"></script>
        <script defer="defer" src="#{resource['js/ie-compat.js']}?version=#{settingsWrapper.appVersion}"></script>
        <script defer="defer" src="#{resource['js/owl.carousel.js']}?version=#{settingsWrapper.appVersion}"></script>
        <script defer="defer" src="#{resource['js/jquery.matchHeight.js']}?version=#{settingsWrapper.appVersion}"></script>
        <script src="#{resource['js/jquery.sharrre.js']}?version=#{settingsWrapper.appVersion}"></script>
        <script src="#{resource['js/clipboard.min.js']}?version=#{settingsWrapper.appVersion}"></script>
        <o:onloadScript>bind_bsui_components();</o:onloadScript>
        <ui:fragment rendered="#{settingsWrapper.getCVocConf(false).size() > 0}">
            <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
            <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
        </ui:fragment> 
        <ui:fragment rendered="#{settingsWrapper.shibPassiveLoginEnabled}">
            <script defer="defer" src="#{resource['js/shib/isPassive.js']}"></script>
        </ui:fragment>
        <script>
            //<![CDATA[
            $(document).ready(function () {
                // Navbar Search Toggle
                $(document).on('click', '#navbar-search-toggle', function (e) {
                    $(this).parent("li").hide();
                    $("form.navbar-form[role='search']").show();
                });
                $('body').click(function (e) {
                    if (!$(e.target).closest("form.navbar-form[role='search']").length) {
                        $("form.navbar-form[role='search']").hide();
                        $("#navbar-search-toggle").parent("li").show();
                    }
                    ;
                });
            });
            function clickSupportLink() {
                $("[id$='headerSupportLink']").click();
            }
            //]]>
        </script>
    </h:body>
    </f:view>
</html>
